clear all
set more off
cd "/Users/yasenov/Dropbox (IPL)/RefugeeBan/Data"

use "WRAPS/wraps.dta"

isid year state city origin

keep if year <= 2016

**********
**********
**********
* BY ORIGIN
preserve
replace origin = "Congo" if origin == "Dem. Rep. Congo"

collapse (sum) refugees, by(origin)

sum
gsort - refugees
list if _n <= 10

graph bar ref if _n <= 10, over(origin, sort(1) reverse label(angle(45))) ///
	subtitle("Panel A: Top Origin Countries") ///
	ytitle("Number of Refugee Arrivals", size(med)) ///
	name(g1)
restore

**********
**********
**********
* BY STATE
preserve
collapse (sum) refugees, by(state_abbr)
sum
replace state_abbr = upper(state_abbr)
gsort - refugees
list if _n <= 10
graph bar ref if _n <= 10, over(state_abbr, sort(1) reverse) ///
	subtitle("Panel B: Top Receiving States") ///
	ytitle("")  ///
	name(g2)
restore

graph combine g1 g2, imargin(vsmall) 
graph export "../results/fig_wraps_bar.pdf", replace
